package com.hc.conferencecheck.config;

import com.hc.conferencecheck.interceptors.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 注册自定义拦截器的配置类
 */
//@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport {
    /**
     * 注册自定义拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //先取消注册拦截器，最后测试时再进行注册
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**");
    }
}
